load("@prelude//toolchains/android/tools:build_rules.bzl", "buck_java_binary", "buck_kotlin_library")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

buck_kotlin_library(
    name = "exceptions",
    srcs = [
        "AndroidInstallErrorTag.kt",
        "AndroidInstallException.kt",
    ],
    visibility = ["PUBLIC"],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/core/util/log:log",
        "prelude//toolchains/android/src/com/facebook/buck/installer:installer_server",
    ],
)

buck_kotlin_library(
    name = "installer_android_lib",
    srcs = glob([
        "*.java",
        "*.kt",
    ]),
    visibility = [
        "PUBLIC",
    ],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/android:helpers",
        "prelude//toolchains/android/src/com/facebook/buck/android:utils_api",
        "prelude//toolchains/android/src/com/facebook/buck/android/device:device",
        "prelude//toolchains/android/src/com/facebook/buck/core/filesystems:filesystems",
        "prelude//toolchains/android/src/com/facebook/buck/core/util/log:log",
        "prelude//toolchains/android/src/com/facebook/buck/installer:installer_server",
        "prelude//toolchains/android/src/com/facebook/buck/util:process_executor",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:environment",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:platform",
        "prelude//toolchains/android/src/com/facebook/buck/util/json:json",
        "prelude//toolchains/android/third-party:args4j",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:jsr305",
    ],
)

buck_java_binary(
    name = "android_installer",
    main_class = "com.facebook.buck.installer.android.AndroidInstallerMain",
    visibility = [
        "PUBLIC",
    ],
    deps = [
        ":installer_android_lib",
    ],
)
